home *** CD-ROM | disk | FTP | other *** search
- head 1.8;
- branch ;
- access ;
- symbols beta10:1.7;
- locks death:1.8;
- comment @# @;
-
-
- 1.8
- date 93.04.04.23.30.31; author death; state Exp;
- branches ;
- next 1.7;
-
- 1.7
- date 93.01.09.21.07.24; author death; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 93.01.01.11.51.32; author death; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 92.12.31.15.34.11; author death; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 92.12.05.23.07.20; author death; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 92.12.03.18.01.48; author death; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 92.11.27.19.37.53; author death; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 92.11.08.09.28.46; author death; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.8
- log
- @Sun Apr 4 23:30:31 PDT 1993
- @
- text
- @%BEGIN Arcs
-
- %
- % Note:
- % setupForArcPath, penWidth and penHeight defined in Common file
- %
-
- %%%%%%%%%%%%%
- % Name: arcpath
- % Syntax: top left bottom right start stop arcpath -
- % About: Given the coordinates for a rectangle, a start and finish angle,
- % build a PICT style wedge/arc. Note that we rely on the Common
- % setupForArcPath to do the necessary scaling of user space.
- % Note: this uses and sets the 'global' last* variables.
- %%%%%%%%%%%%%
- /arcpath
- {
- /finishAng exch def
- /startAng exch def
- /lastright exch def
- /lastbottom exch def
- /lastleft exch def
- /lasttop exch def
- %
- % produce an arc-wedge along the specified angles.
- %
- newpath
- lastright lastleft sub % compute width & height
- lastbottom lasttop sub
- lastbottom lastleft setupForArcPath
- /radius exch def
- /yoffset exch def
- /xoffset exch def
- xoffset yoffset moveto
- xoffset yoffset radius startAng finishAng arc
- closepath
- }
- def
-
- %%%%%%%%%%%%%
- % Name: frameArc [0060]
- % Syntax: top left bottom right start-angle stop-angle frameArc -
- % About: Use coords of a rectangle, plus the starting and finishing
- % angle, and frames the outline of a portion of an oval's outline
- % (an arc), using the values of penWidth and penHeight.
- % If the penwidth and height are both 1, then we do a special case
- % framing, because it looks a bit better, and will doubtlessly be
- % used frequently. Otherwise, we use the setupForArcPath routine
- % to build an oval path which we then frame part of.
- % Note: to get the penwidth and heigh effect, we frame an arc inside
- % the first, and then fill the space between them.
- % Note that the last* values are modified and used here
- %%%%%%%%%%%%%
- /frameArc
- {
- /finishAng exch def
- /startAng exch def
- /lastright exch def
- /lastbottom exch def
- /lastleft exch def
- /lasttop exch def
-
- gsave
- penPattern usePattern
-
- /thewidth lastright lastleft sub def
- /theheight lastbottom lasttop sub def
- %
- % special case for pens that are 1 by 1 pixel
- %
- penHeight 1 eq
- penWidth 1 eq
- and
- {
- newpath
- thewidth theheight lastbottom lastleft setupForArcPath
- startAng finishAng arc
- stroke
- }
- {
- %
- % More general case for penwidths and heights != 1
- %
- penHeight 0 gt % We don't want to draw with a 0 sized pen.
- penWidth 0 gt
- and
- {
- /startmatrix matrix currentmatrix def
- newpath
- thewidth theheight lastbottom lastleft setupForArcPath
- startAng finishAng arc
- %
- % Recover from the distortions to user space that
- % setupForArcPath did, and calculate the dimensions
- % of an inner rectangle bounding the arc's oval.
- %
- startmatrix setmatrix
-
- /innerRight lastright penWidth sub 1 add def
- /innerTop lasttop penHeight add 1 sub def
- /innerLeft lastleft penWidth add 1 sub def
- /innerBottom lastbottom penHeight sub 1 add def
- /innerWidth innerRight innerLeft sub def
- /innerHeight innerBottom innerTop sub def
-
- innerWidth innerHeight innerBottom innerLeft
- setupForArcPath
- finishAng startAng arcn
- closepath
- fill
- }
- if
- }
- ifelse
- grestore
- }
- def
-
- %%%%%%%%%%%%%
- % Name: paintArc [0061]
- % Syntax: t l b r start finish paintArc -
- % About: pass parameters to arcpath, and fill the resulting arc.
- %%%%%%%%%%%%%
- /paintArc
- {
- gsave
- penPattern usePattern
- arcpath
- fill
- grestore
- }
- def
-
- %%%%%%%%%%%%%
- % Name: eraseArc [0062]
- % Syntax: t l b r start finish eraseArc -
- % About: Pass params to arcpath and fill the wedge with background pat
- %%%%%%%%%%%%%
- /eraseArc
- {
- gsave
- backPattern usePattern
- arcpath
- fill
- grestore
- }
- def
-
- %%%%%%%%%%%%%
- % Name: invertArc [0063]
- % Syntax: t l b r start finish invertArc -
- % About: Calls arcpath, only to get last* values stored, 'cause we
- % don't even try to invert the arc.
- %%%%%%%%%%%%%
- /invertArc
- {
- gsave
- arcpath
- grestore
- }
- def
-
- %%%%%%%%%%%%%
- % Name: fillArc [0064]
- % Syntax: t l b r start finish fillArc -
- % About: Passes params to arcpath, and fills the resulting wedge.
- %%%%%%%%%%%%%
- /fillArc
- {
- gsave
- fillPattern usePattern
- arcpath
- fill
- grestore
- }
- def
-
- %%%%%%%%%%%%%
- % Name: frameSameArc [0068]
- % Syntax: start finish frameSameArc -
- % About: Use last* values and params to frame an arc
- %%%%%%%%%%%%%
- /frameSameArc
- {
- /endAng exch def
- /startAng exch def
- lasttop lastleft lastbottom lastright startAng endAng frameArc
- }
- def
-
- %%%%%%%%%%%%%
- % Name: paintSameArc [0069]
- % Syntax: start finish paintSameArc -
- % About: Use last* values and params to paint an arc
- %%%%%%%%%%%%%
- /paintSameArc
- {
- /endAng exch def
- /startAng exch def
- lasttop lastleft lastbottom lastright startAng endAng paintArc
- }
- def
-
- %%%%%%%%%%%%%
- % Name: eraseSameArc [006A]
- % Syntax: start finish eraseSameArc -
- % About: Use last* values and params to erase an arc
- %%%%%%%%%%%%%
- /eraseSameArc
- {
- /endAng exch def
- /startAng exch def
- lasttop lastleft lastbottom lastright startAng endAng eraseArc
- }
- def
-
- %%%%%%%%%%%%%
- % Name: invertSameArc [006B]
- % Syntax: start finish invertSameArc -
- % About: Use last* values and params to (try to) invert an arc
- %%%%%%%%%%%%%
- /invertSameArc
- {
- /endAng exch def
- /startAng exch def
- lasttop lastleft lastbottom lastright startAng endAng invertArc
- }
- def
-
- %%%%%%%%%%%%%
- % Name: fillSameArc [006C]
- % Syntax: start finish fillSameArc -
- % About: Use last* values and params to (try to) fill an arc
- %%%%%%%%%%%%%
- /fillSameArc
- {
- /endAng exch def
- /startAng exch def
- lasttop lastleft lastbottom lastright startAng endAng fillArc
- }
- def
-
- %END Arcs
- @
-
-
- 1.7
- log
- @Sat Jan 9 21:07:24 PST 1993
- @
- text
- @d99 4
- a102 4
- /innerRight lastright penWidth sub def
- /innerTop lasttop penHeight add def
- /innerLeft lastleft penWidth add def
- /innerBottom lastbottom penHeight sub def
- @
-
-
- 1.6
- log
- @Fri Jan 1 11:51:32 PST 1993
- @
- text
- @@
-
-
- 1.5
- log
- @Thu Dec 31 15:34:11 PST 1992
- @
- text
- @@
-
-
- 1.4
- log
- @Sat Dec 5 23:07:19 PST 1992
- @
- text
- @d3 13
- a15 14
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % utility: arcpath
- % Syntax: top left bottom right start-angle stop-angle frameit arcpath -
- % Description:
- % takes a rectangle (top left bottom right), a start and finish angle values, and
- % a flag indicating whether the arc is to be framed or not (whether we should
- % close the path) and builds an arc from it,
- % setting the last rect values in the process
- % This is a bit tricky. When oval is not a circle, we must scale the coordinate
- % space so that we draw an oval shape. This als means we must fiddle with
- % numbers to determine where the center is in the scaled space.
- % Weirdnesses:
- % We use the lastrect globals for local variable use here...
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- a23 3
-
- /thewidth lastright lastleft sub def
- /theheight lastbottom lasttop sub def
- d28 3
- a30 1
- thewidth theheight lastbottom lastleft setupForArcPath
- a36 1
-
- d40 2
- a41 6
-
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0060
- % Name: frameArc
- d43 11
- a53 15
- % Description:
- % Takes a rectangle (top left bottom right) and builds the frame (outline) of
- % an oval from it, using the current penwidth and height
- % This is, unfortunately, a very long routine. It's made up of
- % basically 3 parts: A case when the penwidth and height are both 1,
- % a case when the oval width is greater than the oval height, and a case when the
- % oval height is greater than the oval width. The first is provided basically as a
- % special case, since this will probably be the most common case for thi to be called,
- % and this case doesn't look as good if processed by the others. In the other two
- % cases, we necessarily distort user space so we can draw an oval. Note that this
- % also involves drawing an oval within the ovalso that we can produce the
- % illusion of an ovalframed by different penwidths and heights.
- % Weirdnesses:
- % We use the lastrect globals for local variable use here...
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d84 1
- a84 1
- penHeight 0 gt % assure that we aren't trying to draw with a 0 sized pen.
- d92 7
- a98 1
-
- d106 2
- a107 2
- startmatrix setmatrix
- innerWidth innerHeight innerBottom innerLeft setupForArcPath
- d119 2
- a120 5
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0061
- % Name: paintArc
- d122 2
- a123 3
- % Description:
- % takes a rectangle and two angle values and paints its Arc on the screen
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d134 2
- a135 3
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0062
- % Name: eraseArc
- d137 2
- a138 3
- % Description:
- % takes a rectangle and two angle values and fills the wedge with the background color
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d149 2
- a150 3
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0063
- % Name: invertArc
- d152 3
- a154 4
- % Description:
- % takes a rectangle and two angle values and does nothing with them other
- % than storing the last 'rectangle' used, implictly in arcpath.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d163 2
- a164 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0064
- % Name: fillArc
- d166 2
- a167 3
- % Description:
- % takes a rectangle and two angle values and fills the wedge they describe
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d178 2
- a179 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0068
- % Name: frameSameArc
- d181 2
- a182 3
- % Description:
- % Use the last... values and two angle values to make a call to frame arc
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d191 2
- a192 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 0069
- % Name: paintSameArc
- d194 2
- a195 3
- % Description:
- % Use the last... values and two angle values to make a call to paint arc
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d204 2
- a205 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 006A
- % Name: eraseSameArc
- d207 2
- a208 3
- % Description:
- % Use the last... values and two angle values to make a call to eraseArc
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d217 2
- a218 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 006B
- % Name: invertSameArc
- d220 2
- a221 3
- % Description:
- % Use the last... values and two angle values to make a call to invert arc
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- d230 2
- a231 4
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Opcode: 006C
- % Name: fillSameArc
- d233 2
- a234 3
- % Description:
- % Use the last... values and two angle values to make a call to fill arc
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- @
-
-
- 1.3
- log
- @Thu Dec 3 18:01:48 PST 1992
- @
- text
- @d75 4
- a78 17
- penPattern usePattern
-
- /thewidth lastright lastleft sub def
- /theheight lastbottom lasttop sub def
- %
- % special case for pens that are 1 by 1 pixel
- %
- penHeight 1 eq
- penWidth 1 eq
- and
- {
- newpath
- thewidth theheight lastbottom lastleft setupForArcPath
- startAng finishAng arc
- stroke
- }
- {
- d80 1
- a80 1
- % More general case for penwidths and heights != 1
- d82 2
- a83 2
- penHeight 0 gt % assure that we aren't trying to draw with a 0 sized pen.
- penWidth 0 gt
- a85 1
- /startmatrix matrix currentmatrix def
- d89 1
- a89 13
-
- /innerRight lastright penWidth sub def
- /innerTop lasttop penHeight add def
- /innerLeft lastleft penWidth add def
- /innerBottom lastbottom penHeight sub def
- /innerWidth innerRight innerLeft sub def
- /innerHeight innerBottom innerTop sub def
-
- startmatrix setmatrix
- innerWidth innerHeight innerBottom innerLeft setupForArcPath
- finishAng startAng arcn
- closepath
- fill
- d91 29
- a119 3
- if
- }
- ifelse
- @
-
-
- 1.2
- log
- @Fri Nov 27 19:37:52 PST 1992
- @
- text
- @@
-
-
- 1.1
- log
- @Sun Nov 8 09:28:46 PST 1992
- @
- text
- @@
-